"""
進入爱逛卖家版
"""
import time

import yaml
from uiautomator2 import xpath


from page_object.guang_page import GuangPage
from resource.path_info import *

"""
订单
"""
class OrderPage(GuangPage):
    """
    查看自营订单
    """
    def check_order_exists_self(self, d):
        print("check_order_exists_self")
        d.xpath(order_self_tab_xpath).wait(timeout=3.0)
        if d.xpath(order_orderNo_xpath).exists:
            print("get order No details successfully")
        else:
            raise Exception("get order No failed")
        return self

    """
    查看选货市场订单
    """

    def check_order_exists_market(self, d):
        print("check_order_exists_market")
        d.xpath(order_market_tab_xpath).click()
        d.xpath(order_orderNo_xpath).wait(timeout=3.0)
        if d.xpath(order_orderNo_xpath).exists:
            print("get order No details successfully")
        else:
            raise Exception("get order No failed")
        d.press("back")
        return self